function t(t) {
    return function() {
        var n = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {};
        return new Promise(function(e, r) {
            n.success = function(t) {
                e(t);
            }, n.fail = function(t) {
                r(t);
            }, t(n);
        });
    };
}

Promise.prototype.finally = function(t) {
    var n = this.constructor;
    return this.then(function(e) {
        return n.resolve(t()).then(function() {
            return e;
        });
    }, function(e) {
        return n.resolve(t()).then(function() {
            throw e;
        });
    });
}, module.exports = {
    postRequest: function(n, e) {
        return t(wx.request)({
            url: n,
            method: "POST",
            data: e,
            header: {
                "content-type": "application/json"
            }
        });
    },
    getRequest: function(n, e) {
        return t(wx.request)({
            url: n,
            method: "GET",
            data: e,
            header: {
                "Content-Type": "application/json"
            }
        });
    }
};